<template>
  <div class="roll_wai">
    <h3>精选专题</h3>
    <div class="roll_right">
      <div class="roll_nei" v-for="item in data" :key="item.id" @click="specia(item)">
        <img :src="item.pic" alt />
        <p>{{item.title}}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      data: [],
    };
  },
  mounted() {
    this.$API.essay().then((res) => {
      //   console.log(res);
      this.data = res.data.data;
    });
  },
  methods: {
    specia(item) {
      console.log(item);
      this.$router.push({
        path: "/sift",
        query: {
          id: item.id,
        },
      });
    },
  },
};
</script>
<style lang="scss">
h3 {
  text-align: center;
}
.roll_wai {
  width: 100vw;
  height: 9rem;
  //    overflow: hidden;
  // overflow: hidden;
  //   position: relative;

  .roll_right {
    // width: 500vw;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 8rem;
    // background: rgb(185, 164, 164);
    display: flex;
   
    .roll_nei {
      background: #f6f6f6;
       margin-right:.5rem;
      img {
        width: 10rem;
        height: 6rem;
      }
      p {
        font-size: 13px;
      }
    }
  }
}
</style>